package com.senthink.gl.business.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.senthink.gl.business.common.entity.BornableEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

/**
 * 民众实体类
 *
 * @author zooqi@senthink.com
 * @date 2017/11/28
 */
@Entity
@Table(name = "gl_people", indexes = {
        @Index(name = "idx_people_lid", columnList = "pid", unique = true),
        @Index(name = "idx_people_idcard", columnList = "idcard", unique = true)
})
@Getter
@Setter
public class People extends BornableEntity<Long> {


    /**
     * 唯一id
     */
    @Column(name = "pid", nullable = false)
    private String pid;

    /**
     * 姓名
     */
    @Column(name = "name")
    private String name;

    /**
     * 身份证号
     */
    @Column(name = "idcard", nullable = false)
    private String idcard;

    /**
     * 公司名称
     */
    @Column(name = "company_name")
    private String companyName;

    /**
     * 公司地址分类 本地  其他
     */
    @Column(name = "site_type")
    private String siteType;

    /**
     * 区域
     */
    @Column(name = "region")
    private String region;

    /**
     * 乡村
     */
    @Column(name = "village")
    private String village;

    /**
     * 详细地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 最后更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "last_modified_time")
    private Date lastModifiedTime;
}
